import { http, Method } from "@/utils/request.js";

/**
 * 获取店铺流量统计
 * @param {*} params
 * @returns
 */
export function getTrafficStatistics(params) {
  return http.request({
    url: `/statistics/view/list`,
    method: Method.GET,
    params,
  });
}

/**
 * 统计相关订单统计
 * @param {*} params
 * @returns
 */
export const getOrderStatistics = (params) => {
  return http.request({
    url: `/statistics/order/order`,
    method: Method.GET,
    params,
  });
};

/**
 * 订单统计概览
 * @param {*} params
 * @returns
 */
export const getOrderOverView = (params) => {
  return http.request({
    url: `/statistics/order/overview`,
    method: Method.GET,
    params,
  });
};

/**
 * 获取订单统计图表
 * @param {*} params
 * @returns
 */
export const getOrderChart = (params) => {
  return http.request({
    url: `/statistics/order`,
    method: Method.GET,
    params,
  });
};

/**
 * 分页获取会员评价
 * @param {*} params
 * @returns
 */
export function getMemberReview(params) {
  return http.request({
    url: `/member/evaluation`,
    method: Method.GET,
    params,
  });
}

/**
 * 根据id获取评价详情
 * @param {*} params
 * @returns
 */
export function getMemberInfoReview(params) {
  return http.request({
    url: `/member/evaluation/get/${params.id}`,
    method: Method.GET,
    params: params,
  });
}

/**
 * 回复评价信息
 * @param {*} params
 * @returns
 */
export function replyMemberReview(id,params) {
  return http.request({
    url: `/member/evaluation/reply/${id}`,
    method: Method.PUT,
    header: { "content-type": "application/x-www-form-urlencoded" },
    data: params,
  });
}
